<?php
/**
 * User: @lixu
 * Date: 2019-08-12
 * Time: 14:39
 */

use Infinity\service\designerVote\LeaderBoardList as sLeaderBoardList;
/**
 * @deprecated
 */
class LeaderBoardListAction extends ActionPlugin
{

    const USER_LEVEL = self::LEVEL_NOTHING;

    public function main()
    {
        $type = $this->getRequest()->getPost('type'); // 榜单类型 1 人气排行榜 2 设计师推荐排行榜 3 业主排行榜

        if(!$type) {
            throw new \Exception('type不存在');
        }

        $page = $this->getRequest()->getPost('page', 1);
        $page = abs($page) ? $page : 1;

        $leaderBoardList['list'] = sLeaderBoardList::getLeaderBoardList($type, $page);
        $this->setSuccess($leaderBoardList);
    }
}